<template>
  <el-dialog
    title="使用提示"
    :visible.sync="dialogVisible"
    :append-to-body="true"
    :width="width"
    class="guide-dialog"
    :before-close="closeGuide"
  >
    <div class="guide-content">
      <div class="guide-item">
        <i class="el-icon-s-operation"></i>
        <span>点击右下角"筛选"按钮可以筛选数据</span>
      </div>
      <div class="guide-item">
        <i class="el-icon-plus"></i>
        <span>使用"手动添加"按钮可以添加数据</span>
      </div>
      <div class="guide-item">
        <i class="el-icon-download"></i>
        <span>使用"爬取铝价"按钮可以获取最新数据</span>
      </div>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-checkbox v-model="doNotShowAgain">不再显示</el-checkbox>
      <el-button type="primary" @click="closeGuide">知道了</el-button>
    </span>
  </el-dialog>
</template>

<script>
export default {
  name: 'MobileGuide',
  props: {
    value: {
      type: Boolean,
      default: false
    },
    width: {
      type: String,
      default: '90%'
    }
  },
  data() {
    return {
      doNotShowAgain: false
    };
  },
  computed: {
    dialogVisible: {
      get() {
        return this.value;
      },
      set(val) {
        this.$emit('input', val);
      }
    }
  },
  methods: {
    closeGuide() {
      this.dialogVisible = false;
      this.$emit('close', this.doNotShowAgain);
    }
  }
}
</script>
